﻿<%@ Page Title="" Language="C#" MasterPageFile="CampusAgent.master" AutoEventWireup="true" CodeFile="AgentOrder.aspx.cs" Inherits="AgentOrder" %>


<%@ Reference Control="StudentInput.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <link href="AgentOrder.css" rel="stylesheet" type="text/css" />


    <style type="text/css">
        .style1
        {
            width: 142px;
        }
        .style2
        {
            height: 34px;
        }
        .style3
        {
            width: 142px;
            height: 34px;
        }
       
        </style>



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
  
    <div id="selecthotel">
       
             <ul>
                 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                 <ContentTemplate>
            <li>
                
                <asp:Label ID="Label_province" runat="server" Text="省份"></asp:Label>
                &nbsp;
                <asp:DropDownList ID="DropDownList_province" runat="server" 
                    DataSourceID="SqlDataSource_province" DataTextField="province" 
                    DataValueField="province" AutoPostBack="True">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource_province" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnString %>" 
                    SelectCommand="SELECT [province], [ProID] FROM [ProvinceTable]"></asp:SqlDataSource>
            </li>
            <li><asp:Label ID="Label_city" runat="server" Text="市"></asp:Label>
                &nbsp;
                <asp:DropDownList ID="DropDownList_city" runat="server" 
                    DataSourceID="SqlDataSource_city" DataTextField="city" 
                    DataValueField="city" AutoPostBack="True">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource_city" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnString %>" 
                    
                    
                    SelectCommand="SELECT DISTINCT [city] FROM [HotelView] WHERE ([province] = @province)">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList_province" Name="province" 
                            PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </li>
            <li>
                <asp:Label ID="Label_county" runat="server" Text="县/地区"></asp:Label>
                &nbsp;
                <asp:DropDownList ID="DropDownList_county" runat="server" 
                    DataSourceID="SqlDataSource_county" DataTextField="county" 
                    DataValueField="county" AutoPostBack="True"  >
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource_county" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnString %>" 
                    
                    
                    SelectCommand="SELECT DISTINCT [county] FROM [HotelView] WHERE (([province] = @province) AND ([city] = @city))">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList_province" Name="province" 
                            PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="DropDownList_city" Name="city" 
                            PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </li>
            <li>
                <asp:Label ID="Label_hotel" runat="server" Text="宾馆"></asp:Label>
                &nbsp;&nbsp;
                <asp:DropDownList ID="DropDownList_hotel" runat="server" 
                    DataSourceID="SqlDataSource_hotel" DataTextField="hotelname" 
                    DataValueField="hotelID"
                      AutoPostBack="True" >
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource_hotel" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnString %>" 
                    
                    
                    
                    SelectCommand="SELECT [hotelID], [hotelname] FROM [HotelView] WHERE (([province] = @province) AND ([city] = @city) AND ([county] = @county))">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="DropDownList_province" Name="province" 
                            PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="DropDownList_city" Name="city" 
                            PropertyName="SelectedValue" Type="String" />
                        <asp:ControlParameter ControlID="DropDownList_county" Name="county" 
                            PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </li>
              </ContentTemplate>
         </asp:UpdatePanel>  
            <li>
                <asp:Button ID="Button_selhotelOK" runat="server" Text="确定" 
                    onclick="Button_selhotelOK_Click" style="width: 40px;" />
            </li>

            <li>  
            <asp:Label ID="Label_searchhotel" runat="server" Text="按宾馆名查找"></asp:Label>
            &nbsp;
            <asp:TextBox ID="TextBox_searchhotel"
                runat="server"></asp:TextBox>
            &nbsp;
            <asp:Button ID="Button_searchhotel" runat="server" Text="查找" 
                    onclick="Button_searchhotel_Click" />
                      
            </li>
        </ul>
        
          
       
    </div>
    <div id="showhotel">
       <asp:Table ID="Table_freeroom" runat="server">
             </asp:Table>
         <asp:Panel ID="Panel_showhotel" runat="server">
          
             <asp:GridView ID="GridView_showhotel" runat="server" AllowPaging="True" 
                 AutoGenerateColumns="False" BorderStyle="None" DataKeyNames="hotelID" 
                 DataSourceID="SqlDataSource_showhotel" 
                 onselectedindexchanged="GridView_showhotel_SelectedIndexChanged" 
                 Visible="False">
                 <Columns>
                     <asp:CommandField ShowSelectButton="True" />
                     <asp:BoundField DataField="hotelID" HeaderText="hotelID" ReadOnly="True" 
                         SortExpression="hotelID" Visible="False" />
                     <asp:BoundField DataField="hotelname" HeaderText="宾馆名称" 
                         SortExpression="hotelname" />
                     <asp:BoundField DataField="province" HeaderText="省份" 
                         SortExpression="province" />
                     <asp:BoundField DataField="city" HeaderText="城市" SortExpression="city" />
                     <asp:BoundField DataField="county" HeaderText="县/市" SortExpression="county" />
                     <asp:BoundField DataField="address" HeaderText="地址" SortExpression="address" />
                     <asp:BoundField DataField="telephonenumber" HeaderText="电话" 
                         SortExpression="telephonenumber" />
                 </Columns>
             </asp:GridView>
             <asp:SqlDataSource ID="SqlDataSource_showhotel" runat="server" 
                 ConnectionString="<%$ ConnectionStrings:ConnString %>" 
                 SelectCommand="SELECT DISTINCT [hotelname], [province], [hotelID], [city], [county], [address], [telephonenumber] FROM [Hotel] WHERE ([hotelname] LIKE '%' + @hotelname + '%')">
                 <SelectParameters>
                     <asp:ControlParameter ControlID="TextBox_searchhotel" Name="hotelname" 
                         PropertyName="Text" Type="String" />
                 </SelectParameters>
             </asp:SqlDataSource>
          
            <asp:Table ID="Table_showhotel" runat="server" Visible="False">
            </asp:Table>
            <asp:Button ID="Button_showhotel" runat="server" Text="确定选择" Visible="False" 
                onclick="Button_showhotel_Click" />
        </asp:Panel>
             
    </div>
    <div id="input">
         <div id="inputleft">
         <div id="inputleft_top">
         <table>
             <tr>
                 <td>
                     <asp:Label ID="Label_studentnum" runat="server" Text="学生人数"></asp:Label>
                 </td>
                 <td >
                     <asp:TextBox ID="TextBox_studentnum"  runat="server" MaxLength="5" >0</asp:TextBox>
                 </td>
                 <td>
                     <asp:Button ID="Button_studentnum" runat="server" 
                         onclick="Button_studentnum_Click" Text="确定" />
                 </td>
             </tr>
             <tr>
                 <td>
                     &nbsp;</td>
                 <td >
                     <asp:RangeValidator ID="RangeValidator1" runat="server" 
                         ControlToValidate="TextBox_studentnum" ErrorMessage="请输入数字！" 
                         MaximumValue="99999" MinimumValue="0"></asp:RangeValidator>
                 </td>
                 <td>
                     &nbsp;</td>
             </tr>
             <tr>
                 <td>
                     &nbsp;</td>
                 <td  >
                     &nbsp;</td>
                 <td>
                     &nbsp;</td>
             </tr>
             <tr>
                 <td colspan="3">
                     
                     
                     
                 </td>
             </tr>
             </table>
         </div>
         <div id="inputleft_bottom">
             <asp:PlaceHolder ID="PlaceHolder_student" runat="server"></asp:PlaceHolder>
         </div>

         </div>
         <div id="inputright">
                     <div> 
                     <table>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_selhotel" runat="server" Text="宾馆名称 *"></asp:Label>
                             </td>
                             <td class="style1">
                                 <asp:Label ID="Label_hotelname" runat="server"></asp:Label>
                             </td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_address" runat="server" Text="宾馆地址 *"></asp:Label>
                             </td>
                             <td class="style1">
                                 <asp:Label ID="Label_hoteladdress" runat="server"></asp:Label>
                             </td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_sethoteltel" runat="server" Text="宾馆电话 *"></asp:Label>
                             </td>
                             <td class="style1">
                                 <asp:Label ID="Label_hoteltelnum" runat="server"></asp:Label>
                             </td>
                         </tr>
                         <tr>
                             <td class="style2">
                                 <asp:Label ID="Label_agent" runat="server" Text="代理人编号 *" Visible="False"></asp:Label>
                             </td>
                             <td class="style3">
                                 <asp:Label ID="Label_agentnum" runat="server" Visible="False"></asp:Label>
                             </td>
                         </tr>
                         <tr>
                             <td class="style2">
                                 <asp:Label ID="Label_room1" runat="server" Text="单人间"></asp:Label>
                             </td>
                             <td class="style3">
                                 <asp:TextBox ID="TextBox_room1" runat="server"></asp:TextBox>数量</td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_room2" runat="server" Text="双人间"></asp:Label>
                             </td>
                             <td class="style1">
                                 <asp:TextBox ID="TextBox_room2" runat="server"></asp:TextBox>
                                 数量</td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_room3" runat="server" Text="三人间"></asp:Label>
                             </td>
                             <td class="style1">
                                 <asp:TextBox ID="TextBox_room3" runat="server"></asp:TextBox>
                                 数量</td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_room4" runat="server" Text="四人间"></asp:Label>
                             </td>
                             <td class="style1">
                                 <asp:TextBox ID="TextBox_room4" runat="server"></asp:TextBox>
                                 数量</td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_starttime" runat="server" Text="起始时间 *"></asp:Label>
                             </td>
                             <td>
                               
                                 <asp:UpdatePanel ID="UpdatePanel_starttime" runat="server">
                                 <ContentTemplate>
                                     <asp:Panel ID="Panel_starttime" runat="server">
                                      <asp:TextBox ID="TextBox_starttime" runat="server" ></asp:TextBox>
                                     <asp:Button ID="Button_starttime" runat="server" Text="ˇ" 
                                         onclick="Button_starttime_Click" />
                                     <asp:Calendar ID="Calendar_start" runat="server" 
                                     onselectionchanged="Calendar_start_SelectionChanged" Visible="False" >
                                         <DayHeaderStyle BackColor="#3399FF" ForeColor="White" />
                                     </asp:Calendar>
                                     </asp:Panel>
                                  
                                 </ContentTemplate>
                                 </asp:UpdatePanel>
                               
                                 
                             </td>
                         </tr>
                         <tr>
                             <td>
                                 <asp:Label ID="Label_endtime" runat="server" Text="结束时间 *"></asp:Label>
                             </td>
                             <td>
                                
                                 <asp:UpdatePanel ID="UpdatePanel_endtime" runat="server">
                                     <ContentTemplate>
                                         <asp:Panel ID="Panel_endtime" runat="server">
                                         <asp:TextBox ID="TextBox_endtime" runat="server"></asp:TextBox>
                                         <asp:Button ID="Button_endtime" runat="server" Text="ˇ" 
                                             onclick="Button_endtime_Click" />
                                         <asp:Calendar ID="Calendar_end" runat="server" 
                                             onselectionchanged="Calendar_end_SelectionChanged" Visible="False">
                                             <DayHeaderStyle BackColor="#3399FF" ForeColor="White" />
                                             </asp:Calendar>
                                         
                                         </asp:Panel>
                                         
                                     </ContentTemplate>
                                  </asp:UpdatePanel>
                             </td>
                         </tr>
                         <tr>
                             <td>
                                 &nbsp;</td>
                             <td>
                                 &nbsp;</td>
                         </tr>
                     </table>
                      </div> 

                     <div>  
                     
                     <table width="100%">
                     	<tr>
                     		<td>
                                &nbsp;</td>
                     	</tr>
                     	<tr>
                     		<td>
                                 &nbsp;</td>
                     	</tr>
                     </table>
                     </div> 
          </div>
         
    </div>
    </ContentTemplate>
     </asp:UpdatePanel>
     <center>
     <asp:Button ID="Button_ok" runat="server" onclick="Button_ok_Click" 
             style="width: 40px; height: 21px;" Text="提交" />
      </center>
</asp:Content>

